﻿using Microsoft.WindowsAzure.ServiceRuntime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebRole1
{
	public partial class Site1 : System.Web.UI.MasterPage
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			//hlMyAT.NavigateUrl = "ActiveTopics.aspx?user=" + "FinancialBubble";

			//ForumConfigurationHandler cc = (ForumConfigurationHandler)ConfigurationManager.GetSection("ForumConfig/settings");
			//string xxxx = cc.MaxPostsPerPage.ToString();


			//if (lblHeader != null && lblHeader.Visible)
			//{
			//   lblHeader.Text = RoleEnvironment.GetConfigurationSettingValue("ForumTitle");
			//}

			lblSubHeader.Text = RoleEnvironment.GetConfigurationSettingValue("ForumSubTitle");
			lblUsername.Text = "Not logged in";


			HttpCookie aCookie = Request.Cookies["ForumSettings"];
			if (aCookie != null)
			{
				if (aCookie["Username"] != null)
				{
					lblUsername.Text = "logged in as " + aCookie["Username"].ToString();
					hlMyAT.Visible = true;
					hlMyAT.NavigateUrl = "~/ActiveTopics.aspx?user=" + aCookie["Username"].ToString();
					hlLogin.Visible = false;
				}
			}
			else
			{
				hlLogout.Visible = false;
			}
		}
	}
}